using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Bxas.Core;
using System.Xml.Serialization;
using DigitalAmele.BLL.Abstracts;
using DigitalAmele.BLL.Adapters;
using DigitalAmele.BLL.Core;

namespace DigitalAmele.BLL.Adapters
{
    [XmlType(Namespace = "urn:DataObjects")]
    [XmlRoot(Namespace = "urn:DataObjects")]
    [Serializable]
    public class InstantChat : ColumnInfo
    {
        public InstantChat()
        {
            this.priymatyKeyColumnName = "Id";
            this.priymatyKeyColumnType = typeof(System.Guid);
            this.TableName = "InstantChat";
        }

        #region Fields
		private Guid id = System.Guid.Empty;
		private Guid senderMemberId = System.Guid.Empty;
		private string senderMemberName = string.Empty;
		private Guid receiverMemberId = System.Guid.Empty;
		private string receiverMemberName = string.Empty;
		private string receiverMemberAvatarUrl = string.Empty;
		private DateTime dateOfPost = new DateTime();
		private Guid receiverMemberGroupId = System.Guid.Empty;
		private string receiverMemberGroupName = string.Empty;
		private string message = string.Empty;
		private string senderMemberAvatarUrl = string.Empty;
		private string receiverMemberGroupAvatarUrl = string.Empty;

        #endregion
        
        #region Properties
 
		///<summary>
		///Required = true
		///DBType = uniqueidentifier
		///C# Type = Guid
		///</summary> 
		[ColumnAttributes("Id",true,"Guid")]
		public Guid Id
		{
			 get 
			 {
			    return id;
			 }
			 set 
			 { 
			    if (value != id)
			    { 
			      id = value; 
			      IsUpdateOrInsert.Add(InstantChat.ColumnNames.Id, true); 
			      this.IsDirty = true; 
			    }
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = uniqueidentifier
		///C# Type = Guid
		///</summary> 
		[ColumnAttributes("SenderMemberId",true,"Guid")]
		public Guid SenderMemberId
		{
			 get 
			 {
			    return senderMemberId;
			 }
			 set 
			 { 
			    if (value != senderMemberId)
			    { 
			      senderMemberId = value; 
			      IsUpdateOrInsert.Add(InstantChat.ColumnNames.SenderMemberId, true); 
			      this.IsDirty = true; 
			    }
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = nvarchar
		///C# Type = string
		///</summary> 
		[ColumnAttributes("SenderMemberName",true,"string")]
		public string SenderMemberName
		{
			 get 
			 {
			    return senderMemberName;
			 }
			 set 
			 { 
			    string valueTrimmed = value.Trim(); 

			    if (valueTrimmed != senderMemberName)
			    { 
			      senderMemberName = valueTrimmed; 
			      IsUpdateOrInsert.Add(InstantChat.ColumnNames.SenderMemberName, true); 
			      this.IsDirty = true; 
			    }
			 }
		}
 
		///<summary>
		///Required = false
		///DBType = uniqueidentifier
		///C# Type = Guid
		///</summary> 
		[ColumnAttributes("ReceiverMemberId",false,"Guid")]
		public Guid ReceiverMemberId
		{
			 get 
			 {
			    return receiverMemberId;
			 }
			 set 
			 { 
			    if (value != receiverMemberId)
			    { 
			      receiverMemberId = value; 
			      IsUpdateOrInsert.Add(InstantChat.ColumnNames.ReceiverMemberId, true); 
			      this.IsDirty = true; 
			    }
			 }
		}
 
		///<summary>
		///Required = false
		///DBType = nvarchar
		///C# Type = string
		///</summary> 
		[ColumnAttributes("ReceiverMemberName",false,"string")]
		public string ReceiverMemberName
		{
			 get 
			 {
			    return receiverMemberName;
			 }
			 set 
			 { 
			    string valueTrimmed = value.Trim(); 

			    if (valueTrimmed != receiverMemberName)
			    { 
			      receiverMemberName = valueTrimmed; 
			      IsUpdateOrInsert.Add(InstantChat.ColumnNames.ReceiverMemberName, true); 
			      this.IsDirty = true; 
			    }
			 }
		}
 
		///<summary>
		///Required = false
		///DBType = nvarchar
		///C# Type = string
		///</summary> 
		[ColumnAttributes("ReceiverMemberAvatarUrl",false,"string")]
		public string ReceiverMemberAvatarUrl
		{
			 get 
			 {
			    return receiverMemberAvatarUrl;
			 }
			 set 
			 { 
			    string valueTrimmed = value.Trim(); 

			    if (valueTrimmed != receiverMemberAvatarUrl)
			    { 
			      receiverMemberAvatarUrl = valueTrimmed; 
			      IsUpdateOrInsert.Add(InstantChat.ColumnNames.ReceiverMemberAvatarUrl, true); 
			      this.IsDirty = true; 
			    }
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = datetime
		///C# Type = DateTime
		///</summary> 
		[ColumnAttributes("DateOfPost",true,"DateTime")]
		public DateTime DateOfPost
		{
			 get 
			 {
			    return dateOfPost;
			 }
			 set 
			 { 
			    if (value != dateOfPost)
			    { 
			      dateOfPost = value; 
			      IsUpdateOrInsert.Add(InstantChat.ColumnNames.DateOfPost, true); 
			      this.IsDirty = true; 
			    }
			 }
		}
 
		///<summary>
		///Required = false
		///DBType = uniqueidentifier
		///C# Type = Guid
		///</summary> 
		[ColumnAttributes("ReceiverMemberGroupId",false,"Guid")]
		public Guid ReceiverMemberGroupId
		{
			 get 
			 {
			    return receiverMemberGroupId;
			 }
			 set 
			 { 
			    if (value != receiverMemberGroupId)
			    { 
			      receiverMemberGroupId = value; 
			      IsUpdateOrInsert.Add(InstantChat.ColumnNames.ReceiverMemberGroupId, true); 
			      this.IsDirty = true; 
			    }
			 }
		}
 
		///<summary>
		///Required = false
		///DBType = nvarchar
		///C# Type = string
		///</summary> 
		[ColumnAttributes("ReceiverMemberGroupName",false,"string")]
		public string ReceiverMemberGroupName
		{
			 get 
			 {
			    return receiverMemberGroupName;
			 }
			 set 
			 { 
			    string valueTrimmed = value.Trim(); 

			    if (valueTrimmed != receiverMemberGroupName)
			    { 
			      receiverMemberGroupName = valueTrimmed; 
			      IsUpdateOrInsert.Add(InstantChat.ColumnNames.ReceiverMemberGroupName, true); 
			      this.IsDirty = true; 
			    }
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = nvarchar
		///C# Type = string
		///</summary> 
		[ColumnAttributes("Message",true,"string")]
		public string Message
		{
			 get 
			 {
			    return message;
			 }
			 set 
			 { 
			    string valueTrimmed = value.Trim(); 

			    if (valueTrimmed != message)
			    { 
			      message = valueTrimmed; 
			      IsUpdateOrInsert.Add(InstantChat.ColumnNames.Message, true); 
			      this.IsDirty = true; 
			    }
			 }
		}
 
		///<summary>
		///Required = false
		///DBType = nvarchar
		///C# Type = string
		///</summary> 
		[ColumnAttributes("SenderMemberAvatarUrl",false,"string")]
		public string SenderMemberAvatarUrl
		{
			 get 
			 {
			    return senderMemberAvatarUrl;
			 }
			 set 
			 { 
			    string valueTrimmed = value.Trim(); 

			    if (valueTrimmed != senderMemberAvatarUrl)
			    { 
			      senderMemberAvatarUrl = valueTrimmed; 
			      IsUpdateOrInsert.Add(InstantChat.ColumnNames.SenderMemberAvatarUrl, true); 
			      this.IsDirty = true; 
			    }
			 }
		}
 
		///<summary>
		///Required = false
		///DBType = nvarchar
		///C# Type = string
		///</summary> 
		[ColumnAttributes("ReceiverMemberGroupAvatarUrl",false,"string")]
		public string ReceiverMemberGroupAvatarUrl
		{
			 get 
			 {
			    return receiverMemberGroupAvatarUrl;
			 }
			 set 
			 { 
			    string valueTrimmed = value.Trim(); 

			    if (valueTrimmed != receiverMemberGroupAvatarUrl)
			    { 
			      receiverMemberGroupAvatarUrl = valueTrimmed; 
			      IsUpdateOrInsert.Add(InstantChat.ColumnNames.ReceiverMemberGroupAvatarUrl, true); 
			      this.IsDirty = true; 
			    }
			 }
		}

        #endregion
		        
        #region StringProperties
 
		///<summary>
		///Required = true
		///DBType = uniqueidentifier
		///C# Type = Guid
		///</summary> 
		public virtual string s_Id
		{
			 get 
			 {
			        return Getuniqueidentifier_s(id);
			 }
			 set 
			 { 
			        Setuniqueidentifier_s(value, ref id);
			        IsUpdateOrInsert.Add(InstantChat.ColumnNames.Id, true);
			        this.IsDirty = true;
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = uniqueidentifier
		///C# Type = Guid
		///</summary> 
		public virtual string s_SenderMemberId
		{
			 get 
			 {
			        return Getuniqueidentifier_s(senderMemberId);
			 }
			 set 
			 { 
			        Setuniqueidentifier_s(value, ref senderMemberId);
			        IsUpdateOrInsert.Add(InstantChat.ColumnNames.SenderMemberId, true);
			        this.IsDirty = true;
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = nvarchar
		///C# Type = string
		///</summary> 
		public virtual string s_SenderMemberName
		{
			 get 
			 {
			        return Getnvarchar_s(senderMemberName);
			 }
			 set 
			 { 
			        Setnvarchar_s(value, ref senderMemberName);
			        IsUpdateOrInsert.Add(InstantChat.ColumnNames.SenderMemberName, true);
			        this.IsDirty = true;
			 }
		}
 
		///<summary>
		///Required = false
		///DBType = uniqueidentifier
		///C# Type = Guid
		///</summary> 
		public virtual string s_ReceiverMemberId
		{
			 get 
			 {
			        return Getuniqueidentifier_s(receiverMemberId);
			 }
			 set 
			 { 
			        Setuniqueidentifier_s(value, ref receiverMemberId);
			        IsUpdateOrInsert.Add(InstantChat.ColumnNames.ReceiverMemberId, true);
			        this.IsDirty = true;
			 }
		}
 
		///<summary>
		///Required = false
		///DBType = nvarchar
		///C# Type = string
		///</summary> 
		public virtual string s_ReceiverMemberName
		{
			 get 
			 {
			        return Getnvarchar_s(receiverMemberName);
			 }
			 set 
			 { 
			        Setnvarchar_s(value, ref receiverMemberName);
			        IsUpdateOrInsert.Add(InstantChat.ColumnNames.ReceiverMemberName, true);
			        this.IsDirty = true;
			 }
		}
 
		///<summary>
		///Required = false
		///DBType = nvarchar
		///C# Type = string
		///</summary> 
		public virtual string s_ReceiverMemberAvatarUrl
		{
			 get 
			 {
			        return Getnvarchar_s(receiverMemberAvatarUrl);
			 }
			 set 
			 { 
			        Setnvarchar_s(value, ref receiverMemberAvatarUrl);
			        IsUpdateOrInsert.Add(InstantChat.ColumnNames.ReceiverMemberAvatarUrl, true);
			        this.IsDirty = true;
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = datetime
		///C# Type = DateTime
		///</summary> 
		public virtual string s_DateOfPost
		{
			 get 
			 {
			        return Getdatetime_s(dateOfPost);
			 }
			 set 
			 { 
			        Setdatetime_s(value, ref dateOfPost);
			        IsUpdateOrInsert.Add(InstantChat.ColumnNames.DateOfPost, true);
			        this.IsDirty = true;
			 }
		}
 
		///<summary>
		///Required = false
		///DBType = uniqueidentifier
		///C# Type = Guid
		///</summary> 
		public virtual string s_ReceiverMemberGroupId
		{
			 get 
			 {
			        return Getuniqueidentifier_s(receiverMemberGroupId);
			 }
			 set 
			 { 
			        Setuniqueidentifier_s(value, ref receiverMemberGroupId);
			        IsUpdateOrInsert.Add(InstantChat.ColumnNames.ReceiverMemberGroupId, true);
			        this.IsDirty = true;
			 }
		}
 
		///<summary>
		///Required = false
		///DBType = nvarchar
		///C# Type = string
		///</summary> 
		public virtual string s_ReceiverMemberGroupName
		{
			 get 
			 {
			        return Getnvarchar_s(receiverMemberGroupName);
			 }
			 set 
			 { 
			        Setnvarchar_s(value, ref receiverMemberGroupName);
			        IsUpdateOrInsert.Add(InstantChat.ColumnNames.ReceiverMemberGroupName, true);
			        this.IsDirty = true;
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = nvarchar
		///C# Type = string
		///</summary> 
		public virtual string s_Message
		{
			 get 
			 {
			        return Getnvarchar_s(message);
			 }
			 set 
			 { 
			        Setnvarchar_s(value, ref message);
			        IsUpdateOrInsert.Add(InstantChat.ColumnNames.Message, true);
			        this.IsDirty = true;
			 }
		}
 
		///<summary>
		///Required = false
		///DBType = nvarchar
		///C# Type = string
		///</summary> 
		public virtual string s_SenderMemberAvatarUrl
		{
			 get 
			 {
			        return Getnvarchar_s(senderMemberAvatarUrl);
			 }
			 set 
			 { 
			        Setnvarchar_s(value, ref senderMemberAvatarUrl);
			        IsUpdateOrInsert.Add(InstantChat.ColumnNames.SenderMemberAvatarUrl, true);
			        this.IsDirty = true;
			 }
		}
 
		///<summary>
		///Required = false
		///DBType = nvarchar
		///C# Type = string
		///</summary> 
		public virtual string s_ReceiverMemberGroupAvatarUrl
		{
			 get 
			 {
			        return Getnvarchar_s(receiverMemberGroupAvatarUrl);
			 }
			 set 
			 { 
			        Setnvarchar_s(value, ref receiverMemberGroupAvatarUrl);
			        IsUpdateOrInsert.Add(InstantChat.ColumnNames.ReceiverMemberGroupAvatarUrl, true);
			        this.IsDirty = true;
			 }
		}

        #endregion

		#region ColumnNames
        public class ColumnNames
        {
		public const string Id = "Id";
		public const string SenderMemberId = "SenderMemberId";
		public const string SenderMemberName = "SenderMemberName";
		public const string ReceiverMemberId = "ReceiverMemberId";
		public const string ReceiverMemberName = "ReceiverMemberName";
		public const string ReceiverMemberAvatarUrl = "ReceiverMemberAvatarUrl";
		public const string DateOfPost = "DateOfPost";
		public const string ReceiverMemberGroupId = "ReceiverMemberGroupId";
		public const string ReceiverMemberGroupName = "ReceiverMemberGroupName";
		public const string Message = "Message";
		public const string SenderMemberAvatarUrl = "SenderMemberAvatarUrl";
		public const string ReceiverMemberGroupAvatarUrl = "ReceiverMemberGroupAvatarUrl";

        }
        #endregion
    }
}

namespace DigitalAmele.BLL.Abstracts
{
    public class _InstantChatBs : BaseBs
    {
		public Boolean insert(InstantChat p) { return this._insert<InstantChat>(p); }
        public Boolean update(InstantChat p) { return this._update<InstantChat>(p); }
        public Boolean delete(InstantChat p) { return this._delete<InstantChat>(p); }
        public List<InstantChat> get(string sql) { return this._get<InstantChat>(sql); }
        public List<InstantChat> get(System.Data.SqlClient.SqlCommand sqlcommand) { return this._get<InstantChat>(sqlcommand); }
		public List<InstantChat> get_all(List<string> columnNames) { return this._get_all<InstantChat>(columnNames); }
        public List<InstantChat> get_all_with_all_columns() { return this._get_all_with_all_columns<InstantChat>(); }
		public InstantChat get_by_primarykey(System.Guid pk, List<string> columnNames) { return this._get_by_primarykey<InstantChat>(pk, columnNames); }
    }
}
